//-------------------------------------------------------------------------------
// Copyright (c) 2012 by Silicon Laboratories
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Silicon Laboratories End User
// License Agreement which accompanies this distribution, and is available at
// http://developer.silabs.com/legal/version/v10/License_Agreement_v10.htm
//
//
// Original content and implementation provided by Silicon Laboratories
//-------------------------------------------------------------------------------

//==============================================================================
// WARNING:
//
// This file is auto-generated by AppBuilder and should not be modified.
// Any hand modifications will be lost if the project is regenerated.
//==============================================================================

#include "gSPI1.h"

// Include peripheral access modules used in this file
#include <SI32_SPI_B_Type.h>
#include <si32_device.h>
#include <SI32_CLKCTRL_A_Type.h>
//==============================================================================
// Configuration Functions
//==============================================================================
void SPI1_enter_default_mode_from_reset(void)
{
	   SI32_CLKCTRL_A_enable_apb_to_modules_0(SI32_CLKCTRL_0,
	                                                   SI32_CLKCTRL_A_APBCLKG0_PB0|
	                                                   SI32_CLKCTRL_A_APBCLKG0_SPI1|
	                                                   SI32_CLKCTRL_A_APBCLKG0_FLASHCTRL0);



//  SI32_SPI_B_select_data_change_first_edge(SI32_SPI_1);
  SI32_SPI_B_select_4wire_master_mode_nss_high(SI32_SPI_1);
  SI32_SPI_B_write_clkrate(SI32_SPI_1, 0x00000040);
//  SI32_SPI_B_select_clock_idle_high(SI32_SPI_1);
  SI32_SPI_B_set_data_length(SI32_SPI_1, 8);
  SI32_SPI_B_select_master_mode(SI32_SPI_1);
//  SI32_SPI_B_select_direction_lsb_first(SI32_SPI_1);
  SI32_SPI_B_enable_module(SI32_SPI_1);
}

